<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>js模块化之合并导入</title>
</head>
<body>
  <ul>
    <li>有时需要从多个模块中导入，有可能会出现同名成员，因此将多个模块先集成(合并)为一个模块</li>
    <li>在集成模块中使用批量导入，然后以具名导出方式提供子模块入口</li>
  </ul>
  <script type="module">
    // 模块合并导入导出
    import { user, data } from './merge.js'

    console.log(user.name)      // Miracle
    console.log(user.web)       // https://github.com/miracle-git
    user.show()                 // welcome to visit Miracle's git: https://github.com/miracle-git
    const miracle = new data.default('Miracle', 35)
    miracle.show()              // Miracle is 35 years old.
    console.log(data.web)       // https://github.com/miracle-git
  </script>
</body>
</html>